package com.snail.readyvr.util;

import android.content.Context;
import android.content.Intent;
import com.snail.readyvr.activity.AboutActivity;
import com.snail.readyvr.activity.AddVideoActivity;
import com.snail.readyvr.activity.ChangePswActivity;
import com.snail.readyvr.activity.DownloadManagerActivity;
import com.snail.readyvr.activity.LoginActivity;
import com.snail.readyvr.activity.MeActivity;
import com.snail.readyvr.activity.NoLoginActivity;
import com.snail.readyvr.activity.PersonalCenterActivity;
import com.snail.readyvr.activity.RegisterActivity;
import com.snail.readyvr.activity.ScannerActivity;
import com.snail.readyvr.activity.SelectChannelActivity;
import com.snail.readyvr.activity.SettingsActivity;
import com.snail.readyvr.activity.UserAgreementActivity;
import com.snailvr.tv.ui.activity.PlayActivity;

/**
 * Created by wangyunpeng on 2016/3/11.
 */
public class StartActivityUtils {

    private StartActivityUtils() {
    }

    public static void startLoginActivity(Context contex, String userName, int from) {
        Intent intent = new Intent(contex, LoginActivity.class);
        if (userName != null) {
            intent.putExtra(IntentParams.LOGIN_USERNAME, userName);
        }
        intent.putExtra(IntentParams.LOGIN_FROM, from);
        contex.startActivity(intent);
    }

    public static void startRegisterActivity(Context contex, int form) {
        Intent intent = new Intent(contex, RegisterActivity.class);
        intent.putExtra(IntentParams.REGISTER_FROM, form);
        contex.startActivity(intent);
    }

    public static void startVideoPlayActivity(Context context) {
        context.startActivity(new Intent(context, PlayActivity.class));
    }

    public static void startChangePswActivity(Context context) {
        context.startActivity(new Intent(context, ChangePswActivity.class));
    }

    public static void startMeActivity(Context context) {
        context.startActivity(new Intent(context, MeActivity.class));
    }

    public static void startMeActivity(Context context, boolean changeSuccess) {
        Intent intent = new Intent(context, MeActivity.class);
        intent.putExtra(IntentParams.CHANGE_PSW, changeSuccess);
        context.startActivity(intent);
    }

    public static void startAddVideoActivity(Context context) {
        context.startActivity(new Intent(context, AddVideoActivity.class));
    }

    public static void startNoLoginActivity(Context contex, int from) {
        Intent intent = new Intent(contex, NoLoginActivity.class);
        intent.putExtra(IntentParams.LOGIN_FROM, from);
        contex.startActivity(intent);
    }

    public static void startVideoPlayer(Context context, String url){
        Intent intent = new Intent(context,PlayActivity.class);
        intent.putExtra(IntentParams.VIDEO_URL,url);
        context.startActivity(intent);
    }

    public static void startScannerActivity(Context context){
        context.startActivity(new Intent(context, ScannerActivity.class));
    }

    public static void startSelectChannelActivity(Context context){
        context.startActivity(new Intent(context, SelectChannelActivity.class));
    }

    public static void startDownloadManagerActivity(Context context){
        context.startActivity(new Intent(context, DownloadManagerActivity.class));
    }

    public static void startPersonalCenterActivity(Context context){
        context.startActivity(new Intent(context, PersonalCenterActivity.class));
    }

    public static void startSettingsActivity(Context context){
        context.startActivity(new Intent(context, SettingsActivity.class));
    }

    public static void startAboutActivity(Context context){
        context.startActivity(new Intent(context, AboutActivity.class));
    }

    public static void startUserAgreementActivity(Context context){
        context.startActivity(new Intent(context, UserAgreementActivity.class));
    }
}
